<template>
    <el-dialog
            :title="title"
            :visible.sync="dialogVisible"
            :width="width"
            :before-close="handleClose"
            :close-on-click-modal="dialogVisiblemodal"
            :close-on-press-escape="dialogVisibleescape"
            append-to-body
    >
        <slot></slot>
        <span slot="footer" class="dialog-footer" v-if="examineVisible">
            <el-button @click="handleClose">{{titlehandleClose}}</el-button>
            <el-button @click="affirm" type="primary">{{titleaffirm}}</el-button>
        </span>
    </el-dialog>
</template>

<script>
    export default {
        name: 'syxPopup',
        props: {
            /**
             * 标题显示
             */
            title: {
                type: String,
                default: "提示"
            },
            /**
             * 确认显示
             */
            titleaffirm: {
                type: String,
                default: "确 认"
            },
            /**
             * 取消显示
             */
            titlehandleClose: {
                type: String,
                default: "取 消"
            },
            /**
             * 弹窗宽度
             */
            width: {
                type: String,
                default: "30%"
            },
            /**
             * 弹窗显示
             */
            dialogVisible: {
                type: Boolean,
                default: false
            },
            /**
             * 禁用遮罩层
             */
            dialogVisiblemodal: {
                type: Boolean,
                default: false
            },
            /**
             * 禁用遮罩层
             */
            dialogVisibleescape: {
                type: Boolean,
                default: false
            },
            /**
             * 是否展示确认/取消
             */
            examineVisible: {
                type: Boolean,
                default: true
            }
        },
        data() {
            return {};
        },
        methods: {
            handleClose() {
                this.$emit("handleClose");
            },
            affirm() {
                this.$emit("affirm");
            }
        }
    };
</script>

<style></style>

